package com.retailshop.shopuser.service;

import com.retailshop.shopuser.entity.*;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

public interface UserNoService {
    int deleteByPrimaryKey(Integer id);

    int insert(UserNo record);

    int insertSelective(UserNo record);

    UserNo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserNo record);
    int findLoginPwd(UserNo record);

    int updateByPrimaryKey(UserNo record);
    List<UserNo> selectUserNoByUserId(int userId);
    /**
     * 用户注册
     * @param map
     * @param request
     * @return
     * @throws Exception
     */
    UserNo userRegister(Map<String,Object> map, HttpServletRequest request) throws  Exception;

    /**
     * 用户账号登录
     * @param map
     * @param request
     * @return
     * @throws Exception
     */
    UserNo userLoginByPwd(Map<String,Object> map,HttpServletRequest request)throws  Exception;

    /**
     * 用户手机号登录
     * @param map
     * @param request
     * @return
     * @throws Exception
     */
    UserNo userLoginByPhone(Map<String,Object> map,HttpServletRequest request)throws  Exception;

    /**
     * 用户设置密码
     * @param
     * @return
     * @throws Exception
     */
    boolean updateUserNoLoginPwd(HttpServletRequest request)throws  Exception;

    /**
     * 发送验证码
      * @param phone
     * @param request
     * @return
     * @throws Exception
     */
     Map<String,Object> sendCodeByPhone(String phone,HttpServletRequest request)throws  Exception;

    /**
     * 申请店铺
     * @param
     * @param request
     * @return
     * @throws Exception
     */
    boolean applyStore(HttpServletRequest request)throws  Exception;

    /**
     * 修改支付密码
     * @param
     * @param request
     * @return
     * @throws Exception
     */
    boolean updatePayPwd(HttpServletRequest request) throws Exception;

    /**
     * 统计用户的分享人
     * @param userNoId
     * @return
     * @throws Exception
     */
//    int statsShareUserNo(int userNoId) throws Exception;

    /**
     * 获取用户资料
     * @param userNoId
     * @return
     */
    UserInfo getUserInfo(int userNoId);


    List<UserSharerInfo> getUserSharesInfo(int userNoId);

    /**
     * 查询用户手机号与编号
     * @param userNoId
     * @return
     */
    SimpleUserInfo getSimpleUserInfo(int userNoId);

    /**
     * 查找推荐人
     * @param userNoId
     * @return
     */
    List<UserNo> getReCommender(int userNoId);

    List<UserNo> selectList();

    int updatSharerTotal(UserNo userNo);


    /**
     *  获取用户的多个账号
     * @return
     */
    List<UserNoLoginInfo> getUserNoList(int userNoId);


    /**
     * 根据用户编号查询用户信息和编号信息
     * @param userNo
     * @return
     */
    UserAndUserNoInfo selectUserAndUserNoByNo(String userNo);

    /**
     * 读取会员最近的店主
     * @param userNoId
     * @return
     */
    UserNo getOwner(int userNoId);

    /**
     * 读取会员最近的店主
     * @param userNoId
     * @return
     */
    UserNo getVera(int userNoId);

    UserNo checkPayPwd(Map<String,Object> map,HttpServletRequest request)throws  Exception;

    List<UserNo> selectUserNoByList(Map<String,Object> map,HttpServletRequest request)throws  Exception;

    List<UserNo> getSupplier();

    List<SwitchUserNo> getUserNoListByUserId(int userId,int userNoId);

    UserNo getUserNoByUserNo(String userNo);

    int updateRankId (@Param("rankId") int rankId, @Param("userNoId") int userNoId);

}
